FYI (Note: The origin of this information may be internal or external to Novell. Novell makes every effort within its means to verify this information. However, the information provided in this document is FOR YOUR INFORMATION only. Novell makes no explicit or implied claims as to the validity of this information.) TITLE: USING SID INSTEAD OF DEBUG TO CREATE A UTILITY DOCUMENT ID#: FYI-M-1115 DATE: 06JAN93 PRODUCT: DR DOS PRODUCT VERSION: 6.0 SUPERSEDES: 13APR92 SYMPTOM: NEED TO TRANSLATE DEBUG INSTRUCTIONS INTO SID ISSUE/PROBLEM: Many publications and bulletin board services distribute scripts written in DEBUG to create various utilities. To make use of these scripts in DR DOS the script must be generated in SID. SOLUTION: Below is a generic listing of a typical DEBUG script and the steps that are used to adjust it so that the DR DOS SID utility will produce the same results. Typically, DEBUG scripts follow this pattern: DEBUG first establishes the name of the file. The "A" command is used to start assembling the instruction. DEBUG defaults to an offset of 100. Then the instructions for the utility itself are listed. Finally, using the "RCX" command DEBUG is instructed as to how many bytes of information should be saved. SID does not require the name of the file until the file is actually saved. In SID, the "A100" command is the instruction that begins assembly at offset 100. The instructions for the utility itself are listed next. These instructions are the same under both DEBUG and SID. When a file is saved using SID, the beginning and ending addresses must be specified. The beginning address is 100. The ending address is 100 + the number of bytes to be saved minus 1 (In the example below, the ending address is represented by the word END). The arithmetic is in hexadecimal values, but it is possible to do the calculations in SID using the "H" command. (See the HEX NOTE below). The last command is Quit. It is the same under both utilities. GENERIC SCRIPT DEBUG SCRIPT SID SCRIPT COMMENTS ----------------------------------------------------------------- N filename.ext (not required) -SID uses file name when it is saved. A A100 ---------+ -Begin assembling instructions. (instructions (instructions | -Use the original commands. go go | here) here) | | | - to exit assembling RCX (not required) | -DEBUG is preparing to save y bytes y (not required) | of data. +----------------+ W Wfilename.ext,100,END| -SID writes|from offset 100 to END | ( 100 + y - 1 = END ) | | +-------+ Q Q -And Quit. Below is an example of a script that will build BEEP.COM, a program that simply beeps the speaker once. Notice again that the arithmetic is in hexadecimal. (If that is something with which you are unfamiliar, see the HEX NOTE at the end of this example.) DEBUG SCRIPT SID SCRIPT COMMENTS -----------------------------------------------------------------N BEEP.COM (not required) SID saves file name at end A A100 --------+ Begin assembling instructions MOV AH,2 MOV AH,2 | Use the original commands MOV DL,07 MOV DL,07 | INT 21 INT 21 | MOV AH,4C MOV AH,4C | INT 21 INT 21 | | to exit assembling RCX (not required) | DEBUG is preparing to save 10 (A Hex) A (not required) | of data. +----------------+ W WKEYD.COM,100,109 | SID writes|from offset 100 to 109 Q Q | ( 100 + A - 1 = 109 ) | | +--------+ HEX NOTE: SID can do the hex math for you. In the above example, to do the first addition ( 100 + A ), load SID and type H100 A SID will respond: + 010A - 00F6 * 00000A00 / 0019 (0006) The first value, 010A, is the sum. Use that value in the next command: H10A 1 SID will respond: + 010B - 0109 * 0000010A / 010A (0000) The second value, 0109, is the END value you want to use. ADDITIONAL REFERENCES: DR DOS 6 User Guide, Appendix D & FYI-M-1114